using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableBusinessVegetablesPrice
	{
		public const string Table = "BusinessVegetablesPrice";
		public const string BusinessVegetablesPriceID = "BusinessVegetablesPriceID";
		public const string BusinessID = "BusinessID";
	}
	
	[Serializable]
	public class BaseBusinessVegetablesPrice
		: IDbSessionEntity, IJsonClass
	{
		int m_BusinessVegetablesPriceID;
		/// <summary>
        /// 
        /// </summary>
        public int BusinessVegetablesPriceID
        {
            get { return m_BusinessVegetablesPriceID; }
            set { m_BusinessVegetablesPriceID = value; }
        }
		
		int? m_BusinessID;
		/// <summary>
        /// 
        /// </summary>
        public int? BusinessID
        {
            get { return m_BusinessID; }
            set { m_BusinessID = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_BusinessVegetablesPriceID = reader[TableBusinessVegetablesPrice.BusinessVegetablesPriceID];
            m_BusinessID = reader[TableBusinessVegetablesPrice.BusinessID];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableBusinessVegetablesPrice.BusinessVegetablesPriceID, PrimaryKeyType.Identity, BusinessVegetablesPriceID);
			writer[TableBusinessVegetablesPrice.BusinessID] = BusinessID;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_BusinessVegetablesPriceID = idd;
        }
		
		public string TableName
        {
            get { return TableBusinessVegetablesPrice.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_BusinessVegetablesPriceID = hashToRead["BusinessVegetablesPriceID"];
			 
             m_BusinessID = hashToRead["BusinessID"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["BusinessVegetablesPriceID"] = BusinessVegetablesPriceID;
			 
            hashToFill["BusinessID"] = BusinessID;
			 
        }

        #endregion
		
	}
}
